package com.wd.live.view.custom

import android.app.Activity
import android.content.Intent
import android.widget.Toast
import androidx.fragment.app.Fragment

/**
 * 作者：马海钊
 * 时间：2023/8/24 14:53
 * 功能：
 */
fun Activity.longToast(msg: String) {
    Toast.makeText(this, msg, Toast.LENGTH_LONG).show()
}


fun Fragment.longToast(msg: String) {
    Toast.makeText(this.requireContext(), msg, Toast.LENGTH_LONG).show()
}

inline fun <reified A : Activity> Activity.lunchActivity() {
    startActivity(Intent(this, A::class.java))
}

inline fun <reified A : Activity> Fragment.lunchActivity() {
    requireActivity().startActivity(Intent(requireActivity(), A::class.java))
}